package com.hibernate.hrm.entity.dto.position;

import com.hibernate.hrm.entity.Department;
import com.hibernate.hrm.entity.Role;
import lombok.Data;

@Data
public class PositionListDTO {
    private Integer positionId;
    private String positionName;
    private String positionCode;
    private Department departmentID;
    private Role positionRoleID;
    private Boolean status;

    public static PositionListDTO fromEntity(com.hibernate.hrm.entity.Position position) {
        PositionListDTO dto = new PositionListDTO();
        dto.setPositionId(position.getPositionId());
        dto.setPositionName(position.getPositionName());
        dto.setPositionCode(position.getPositionCode());
        dto.setDepartmentID(position.getDepartmentID());
        dto.setPositionRoleID(position.getPositionRoleID());
        dto.setStatus(position.getStatus());
        return dto;
    }
}
